package com.xr.hr.ea;

import com.xr.common.CommUtil;
import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.AutoSqlDataset;
import com.bstek.dorado.data.db.SqlDataset;
import com.bstek.dorado.common.*;

/**
 * datasetListener
 */
public class datasetListener extends AbstractDatasetListener {
  public boolean beforeLoadData(Dataset dataset)
     throws Exception {
	  String sql="";
	  String className = dataset.parameters().getString("className");
	  AutoSqlDataset ds = (AutoSqlDataset) dataset;
	  if(className!=null && className.equals("empEaList_datasetEa")){
		  sql=ds.getSql();
		  String psnId=ds.parameters().getString("PSN_ID");
		  if(psnId!=null&&psnId.equals("0")){
			  ds.addSqlMatchRule(" nvl(wf_EA.psn_id,0)=0");
		  }
		  if(psnId!=null&&psnId.equals("1")){ 
			  ds.addSqlMatchRule(" nvl(wf_EA.psn_id,0)>=1");
		  }
	  }
	  
    return true;
  }

}
